data_path=/data/mNGS/runmngs/GZ
ssid=$1
mkdir /data/mNGS/runmngs/GZ/$ssid/cnv
cd /data/mNGS/runmngs/GZ/$ssid/cnv
for i in /data/mNGS/runmngs/GZ/$ssid/*/*.sorted.bam;do echo "sh /home/runmngs/CNV_mNGS/CNV_mNGS38.sh $i ";done >rr.sh
grep -vE "NC|YF|-R" rr.sh >run.sh
rm rr.sh
cat run.sh|xargs -I {} --max-procs=30 bash -c {}
wait

mkdir result

for i in ./*/Scoresheet.txt;do d=${i%%/Scoresheet*};cp $i ./result/${d##*/}_Scoresheet.txt;done
cp *_XY.png ./result
cp *result.txt ./result

for i in *result.txt;do a=`wc -l $i|cut -d " " -f1`;if [ $a != "0" ];then echo ${i%%.re*};fi;done >pos.lis

zip -r ${ssid}_result.zip result

python /home/runmngs/CNV_mNGS/eeemail.py $ssid ${ssid}_result.zip
